/*
 * @Author: your name
 * @Date: 2021-02-20 09:07:25
 * @LastEditTime: 2021-02-20 09:17:51
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \myproject\src\utils\formatTime.js
 */
import dayjs from 'dayjs' // ES 2015
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')
dayjs.extend(relativeTime)
// const rt = dayjs().to(dayjs('1990-01-01')) // "31 years ago"
// console.log(rt)
export const formatTime = (time) => {
  return dayjs().to(dayjs(time))
}
